{# empty Twig template #}
{% extends "EMNewsBundle::layout.html.twig" %}
{% block title 'Author::  Dashboard' %}

{% block content %}
   <div class="title"><h5>Current Status </h5></div>
        <!-- Statistics -->
        <div class="stats">
        	<ul>
               <li><a href=" {{ path('em_news_list', {'status': 'A'}) }}"  class="count green" title="">{{ total | status('A') }}</a><span>Approved</span></li>
               <li><a href=" {{ path('em_news_list', {'status': 'P'}) }}"  class="count yellow" title="">{{ total | status('P') }}</a><span>Pending </span></li>
               <li><a href=" {{ path('em_news_list', {'status': 'D'}) }}"  class="count red" title="">{{ total | status('D') }}</a><span>Declined </span></li>
               <li class="last"><a href=" {{ path('em_news_list', {'status': 'Dr'}) }}"  class="count blue" title="">{{ total | status('Dr') }}</a><span>Draft</span></li>
		</ul>
            <div class="fix"></div>
        </div>
        
   
	<!-- Support tickets -->
        <div class="widget first">
					
                  	<div class="table">
                        <div class="head"><h5 class="iHome">Latest Posts | {{ dt | date }}</h5><div class="num"><a href="#" class="greenNum">+ {{total | length}}</a></div></div>

			<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
                            <thead>
                	<tr>
                        <th width="15%">Title</th>
                        <th width="10%">Author</th>
                        <th width="30%">Meta content</th>
                        <th width="10%">Status</th>
                        <th width="10%">Categories</th>
                        <th width="5%">Date </th>
                        </tr>
                </thead>
                <tbody>
                            {% for key, post in total %}
                            <tr class="gradeA">
                                <td><a href="{{ path('blog_show', {'slug': post.slug}) }}" target="_blank">{{post.title}}</a></td>
                                <td><a href="#" title="">{{ post.author | authors }}</a></td>
                                <td>{{post.metaDescription  }}</td>
                                <td>
                                {% if post.status=='A'%}
                                        <strong class="green">[ Approved ]</strong>
                                {% elseif post.status=='D'%}
                                        <strong class="red">[ Declined ]</strong>
                                {% elseif post.status=='Dr'%}
                                        <strong class="blue">[ Draft ]</strong>
                                {% else %}
                                        <strong class="yellow">[ Pending ]</strong>
                                {% endif %}
                                </td>
                                <td>
                                {% for ctn in catn %}
							{% if post.id==ctn.newsid %}
								{% for ca in categories %}
									{% if ca.id==ctn.categoryid %}
										{{ ca.name }}{%if loop.last==false %},{%endif%}
									{% endif %}
								{% endfor%}
							{% endif %}
						{% endfor %}
                                </td>
                                <td>{{ post.dateCreated | date('m/d/y')}}</td>
                            </tr>
                            {% endfor%}
                  </tbody>
			</table>
                      </div>                    
					</div>				
				
{% endblock %}
